@extends('layouts.layouts')
@section('title')
    <title>后台首页</title>
@endsection
@section('content')
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li><a href="/balance/index">用户余额</a></li>
                <li class="active">余额列表</li>
            </ul>
        </div>
        <div class="main-content">
            
            <div class="row">
                <div class="col-sm-8 col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading no-collapse">消费记录</div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>用户</th>
                                <th>金额</th>
                                <th>支付方式</th>
                                <th>购买课程</th>
                               
                               
                            </tr>
                            </thead>
                            <tbody>
                            @if($list[0])
                                @foreach($list as $v)
                                    <tr>
                                        <td>{{$v->id}}</td>
                                        <td>{{$v->name}}</td>
                                        <td>{{$v->money}}</td>
                                        <td>@if($v->payfrom == "BALANCE") 
                                             余额支付 
                                            @elseif($v->payfrom == "WXPAYH")
                                                 微信H5支付 
                                            @elseif($v->payfrom == "WXPAY")
                                                微信支付
                                            @elseif($v->payfrom == "SPB")
                                                  赛普币支付
                                            @endif</td>
                                        <td>{{$v->courseName}}</td>
                                      
                                    </tr>
                                @endforeach
                            @else
                                <tr>
                                   <td colspan="5" style="text-align:center;">暂无记录</td>
                                </tr>
                            @endif
                            </tbody>

                        </table>

                    </div>
                </div>
            </div>
            
            {{$list->appends(['id'=>$id])->render()}}
        </div>
    </div>
@endsection